package field_method14;

public class Student {
    private String no;
    private double scoreEn;
    private double scoreMath;
    private double scoreCh;

    public Student() {
    }

    public Student(String name, String sex, int age, String no, double scoreEn, double scoreMath, double scoreCh) {
        this.no = no;
        this.scoreEn = scoreEn;
        this.scoreMath = scoreMath;
        this.scoreCh = scoreCh;
    }

    public double aver() {
        return (scoreEn + scoreMath + scoreCh) / 3;
    }

    public double max() {
        return Math.max( Math.max(scoreEn,scoreMath),scoreCh);
    }
    public double min(){
        return Math.min(Math.min(scoreEn,scoreMath),scoreCh);
    }

    public String toString() {
        return super.toString()+"，学号:" + no +"，平均分：" + aver()+"，最高分:"+max()+"，最低分:"+min();
    }
}

